<!DOCTYPE html>
<!-- saved from url=(0057)../automator/selector.html -->
<html lang="zh-CN" data-theme="light" class=" ">

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <meta name="generator" content="VuePress 2.0.0-beta.51" />
  <meta name="theme" content="VuePress Theme Hope" />
  <meta property="og:url" content="selector.html">
  <meta property="og:site_name" content="Auto.js Pro文档">
  <meta property="og:title" content="选择器">
  <meta property="og:type" content="article">
  <meta property="og:updated_time" content="2022-10-22T07:36:15.000Z">
  <meta property="og:locale" content="zh-CN">
  <meta property="og:locale:alternate" content="en-US">
  <meta property="article:modified_time" content="2022-10-22T07:36:15.000Z">
  <link rel="alternate" hreflang="en-us" href="selector.html">
  <link rel="icon" href="../../../../docs/favicon.ico">
  <link rel="manifest" href="../../../../docs/manifest.webmanifest" crossorigin="use-credentials">
  <meta name="theme-color" content="#46bd87">
  <meta name="viewport"
    content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
  <title>选择器 | Auto.js Pro文档</title>
  <meta name="description" content="支持Node.js的自动化工作流JavaScript IDE">
  <style>
    :root {
      --bg-color: #fff;
    }

    html[data-theme="dark"] {
      --bg-color: #1d2025;
    }

    html,
    body {
      background-color: var(--bg-color);
    }
  </style>
  <script>
    const userMode = localStorage.getItem("vuepress-theme-hope-scheme");
    const systemDarkMode =
      window.matchMedia &&
      window.matchMedia("(prefers-color-scheme: dark)").matches;

    if (userMode === "dark" || (userMode !== "light" && systemDarkMode)) {
      document.querySelector("html").setAttribute("data-theme", "dark");
    }
  </script>
  <link rel="stylesheet" href="../../../assets/style.ae9cb182.css">
  <link rel="modulepreload" href="../../../assets/app.6aa2b576.js">
  <link rel="modulepreload" href="../../../assets/app.html.004a89b7.js">
  <link rel="modulepreload" href="../../../assets/_plugin-vue_export-helper.cdc0426e.js">
  <link rel="modulepreload" href="../../../assets/app.html.79d7bc17.js">
</head>

<body>
  <!-- Copyright � 2008. Spidersoft Ltd -->
  <style>
    A.applink:hover {
      border: 2px dotted #DCE6F4;
      padding: 2px;
      background-color: #ffff00;
      color: green;
      text-decoration: none
    }

    A.applink {
      border: 2px dotted #DCE6F4;
      padding: 2px;
      color: #2F5BFF;
      background: transparent;
      text-decoration: none
    }

    A.info {
      color: #2F5BFF;
      background: transparent;
      text-decoration: none
    }

    A.info:hover {
      color: green;
      background: transparent;
      text-decoration: underline
    }
  </style>


  <div id="app"><!--[--><!--[--><!--[--><span tabindex="-1"></span><a href="#main-content"
      class="skip-link sr-only">Skip to content</a><!--]-->
    <div class="theme-container has-toc"><!--[--><!--[-->
      <header class="navbar">
        <div class="navbar-left"><button class="toggle-sidebar-button" title="Toggle Sidebar"><span
              class="icon"></span></button><!----><a href="../../../docs.html" class="brand"><img class="logo"
              src="../../../logo.png" alt="Auto.js Pro文档"><!----><span class="site-name hide-in-pad">Auto.js
              Pro文档</span></a><!----></div>
        <div class="navbar-center"><!---->
          <nav class="nav-links">
            <div class="nav-item hide-in-mobile"><a href="../../../docs.html" class="nav-link"
                aria-label="Auto.js Pro"><span class="icon iconfont icon-home"></span>Auto.js Pro<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="../../guide/guide.html" class="nav-link" aria-label="指南"><span
                  class="icon iconfont icon-creative"></span>指南<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="../v8.html" class="nav-link active" aria-label="第一代API文档"><span
                  class="icon iconfont icon-note"></span>第一代API文档<!----></a></div>
            <div class="nav-item hide-in-mobile"><a href="../../v9/v9.html" class="nav-link" aria-label="第二代API文档"><span
                  class="icon iconfont icon-note"></span>第二代API文档<!----></a></div>
            <div class="nav-item hide-in-mobile">
              <div class="dropdown-wrapper"><button class="dropdown-title" type="button" aria-label="官网与相关链接"><span
                    class="title"><span class="icon iconfont icon-discover"></span>官网与相关链接</span><span
                    class="arrow"></span>
                  <ul class="nav-dropdown">
                    <li class="dropdown-item"><a href="../../../../pro.autojs.html" rel="noopener noreferrer"
                        target="_blank" aria-label="官网与软件下载" class="nav-link"><!---->官网与软件下载<span><svg
                            class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
                            focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                            <path fill="currentColor"
                              d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                            </path>
                            <polygon fill="currentColor"
                              points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                            </polygon>
                          </svg><span class="external-link-icon-sr-only">open in new window</span></span><!----></a>
                    </li>
                    
                    <li class="dropdown-item"><a href="https://pd.qq.com/s/gosos5" rel="noopener noreferrer"
                        target="_blank" aria-label="官方频道" class="nav-link"><!---->官方频道<span><svg
                            class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"
                            focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15">
                            <path fill="currentColor"
                              d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                            </path>
                            <polygon fill="currentColor"
                              points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                            </polygon>
                          </svg><span class="external-link-icon-sr-only">open in new window</span></span><!----></a>
                    </li>
                  </ul>
                </button></div>
            </div>
          </nav><!---->
        </div>
        <div class="navbar-right"><!---->
          <div class="nav-item">
            <div class="dropdown-wrapper i18n-dropdown"><button class="dropdown-title" type="button"
                aria-label="选择语言"><!--[--><svg xmlns="http://www.w3.org/2000/svg" class="icon i18n-icon"
                  viewBox="0 0 1024 1024" fill="currentColor" aria-label="i18n icon"
                  style="width:1rem;height:1rem;vertical-align:middle;">
                  <path
                    d="M379.392 460.8 494.08 575.488l-42.496 102.4L307.2 532.48 138.24 701.44l-71.68-72.704L234.496 460.8l-45.056-45.056c-27.136-27.136-51.2-66.56-66.56-108.544h112.64c7.68 14.336 16.896 27.136 26.112 35.84l45.568 46.08 45.056-45.056C382.976 312.32 409.6 247.808 409.6 204.8H0V102.4h256V0h102.4v102.4h256v102.4H512c0 70.144-37.888 161.28-87.04 210.944L378.88 460.8zM576 870.4 512 1024H409.6l256-614.4H768l256 614.4H921.6l-64-153.6H576zM618.496 768h196.608L716.8 532.48 618.496 768z">
                  </path>
                </svg><!--]--><span class="arrow"></span>
                <ul class="nav-dropdown">
                  <li class="dropdown-item"><a href="https://pro.autojs.org/docs/en/" class="nav-link"
                      aria-label="English"><!---->English<!----></a></li>
                  <li class="dropdown-item"><a aria-current="page"
                      href="../automator/selector.html"
                      class="router-link-active router-link-exact-active nav-link active"
                      aria-label="简体中文"><!---->简体中文<!----></a></li>
                </ul>
              </button></div>
          </div><!---->
          <div class="nav-item hide-in-mobile"><button id="appearance-switch"><svg xmlns="http://www.w3.org/2000/svg"
                class="icon auto-icon" viewBox="0 0 1024 1024" fill="currentColor" aria-label="auto icon"
                style="display:block;">
                <path
                  d="M512 992C246.92 992 32 777.08 32 512S246.92 32 512 32s480 214.92 480 480-214.92 480-480 480zm0-840c-198.78 0-360 161.22-360 360 0 198.84 161.22 360 360 360s360-161.16 360-360c0-198.78-161.22-360-360-360zm0 660V212c165.72 0 300 134.34 300 300 0 165.72-134.28 300-300 300z">
                </path>
              </svg><svg xmlns="http://www.w3.org/2000/svg" class="icon dark-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="dark icon" style="display:none;">
                <path
                  d="M524.8 938.667h-4.267a439.893 439.893 0 0 1-313.173-134.4 446.293 446.293 0 0 1-11.093-597.334A432.213 432.213 0 0 1 366.933 90.027a42.667 42.667 0 0 1 45.227 9.386 42.667 42.667 0 0 1 10.24 42.667 358.4 358.4 0 0 0 82.773 375.893 361.387 361.387 0 0 0 376.747 82.774 42.667 42.667 0 0 1 54.187 55.04 433.493 433.493 0 0 1-99.84 154.88 438.613 438.613 0 0 1-311.467 128z">
                </path>
              </svg><svg xmlns="http://www.w3.org/2000/svg" class="icon light-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="light icon" style="display:none;">
                <path
                  d="M952 552h-80a40 40 0 0 1 0-80h80a40 40 0 0 1 0 80zM801.88 280.08a41 41 0 0 1-57.96-57.96l57.96-58a41.04 41.04 0 0 1 58 58l-58 57.96zM512 752a240 240 0 1 1 0-480 240 240 0 0 1 0 480zm0-560a40 40 0 0 1-40-40V72a40 40 0 0 1 80 0v80a40 40 0 0 1-40 40zm-289.88 88.08-58-57.96a41.04 41.04 0 0 1 58-58l57.96 58a41 41 0 0 1-57.96 57.96zM192 512a40 40 0 0 1-40 40H72a40 40 0 0 1 0-80h80a40 40 0 0 1 40 40zm30.12 231.92a41 41 0 0 1 57.96 57.96l-57.96 58a41.04 41.04 0 0 1-58-58l58-57.96zM512 832a40 40 0 0 1 40 40v80a40 40 0 0 1-80 0v-80a40 40 0 0 1 40-40zm289.88-88.08 58 57.96a41.04 41.04 0 0 1-58 58l-57.96-58a41 41 0 0 1 57.96-57.96z">
                </path>
              </svg></button></div>
          <div class="search-box" role="search" data-v-f3875574=""><input value="" aria-label="Search" class=""
              placeholder="Search" autocomplete="off" spellcheck="false" data-v-f3875574=""><!----></div><!----><button
            class="toggle-navbar-button" aria-label="Toggle Navbar" aria-expanded="false"
            aria-controls="nav-screen"><span class="button-container"><span class="button-top"></span><span
                class="button-middle"></span><span class="button-bottom"></span></span></button>
        </div>
      </header><!----><!--]--><!---->
      <div class="toggle-sidebar-wrapper"><span class="arrow left"></span></div>
      <aside class="sidebar"><!--[--><!----><!--]-->
        <ul class="sidebar-links">
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading"><!----><span class="title">指南</span><!----></p>
              <ul class="sidebar-links">
                <li><!--[--><a href="../" class="nav-link sidebar-link sidebar-page"
                    aria-label="阅读须知"><!---->阅读须知<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading active"><!----><span class="title">API文档</span><!----></p>
              <ul class="sidebar-links">
                <li>
                  <section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span
                        class="title">自动化 - 控件操作</span><span class="arrow down"></span></button>
                    <ul class="sidebar-links">
                      <li><!--[--><a href="../automator/index.html"
                          class="nav-link sidebar-link sidebar-page" aria-label="入门介绍"><!---->入门介绍<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                      <li><!--[--><a href="../automator/selector.html"
                          class="router-link-active router-link-exact-active nav-link sidebar-link sidebar-page active"
                          aria-label="选择器" aria-current="page"><!---->选择器<!----></a>
                        <ul class="sidebar-sub-headers">
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#selector"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="selector()"><!---->selector()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-algorithm-algorithm"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.algorithm(algorithm)"><!---->UiSelector.algorithm(algorithm)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-text-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.text(str)"><!---->UiSelector.text(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-textcontains-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.textContains(str)"><!---->UiSelector.textContains(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-textstartswith-prefix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.textStartsWith(prefix)"><!---->UiSelector.textStartsWith(prefix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-textendswith-suffix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.textEndsWith(suffix)"><!---->UiSelector.textEndsWith(suffix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-textmatches-reg"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.textMatches(reg)"><!---->UiSelector.textMatches(reg)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-desc-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.desc(str)"><!---->UiSelector.desc(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-desccontains-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.descContains(str)"><!---->UiSelector.descContains(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-descstartswith-prefix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.descStartsWith(prefix)"><!---->UiSelector.descStartsWith(prefix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-descendswith-suffix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.descEndsWith(suffix)"><!---->UiSelector.descEndsWith(suffix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-descmatches-reg"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.descMatches(reg)"><!---->UiSelector.descMatches(reg)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-id-resid"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.id(resId)"><!---->UiSelector.id(resId)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-idcontains-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.idContains(str)"><!---->UiSelector.idContains(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-idstartswith-prefix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.idStartsWith(prefix)"><!---->UiSelector.idStartsWith(prefix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-idendswith-suffix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.idEndsWith(suffix)"><!---->UiSelector.idEndsWith(suffix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-idmatches-reg"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.idMatches(reg)"><!---->UiSelector.idMatches(reg)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-classname-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.className(str)"><!---->UiSelector.className(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-classnamecontains-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.classNameContains(str)"><!---->UiSelector.classNameContains(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-classnamestartswith-prefix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.classNameStartsWith(prefix)"><!---->UiSelector.classNameStartsWith(prefix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-classnameendswith-suffix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.classNameEndsWith(suffix)"><!---->UiSelector.classNameEndsWith(suffix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-classnamematches-reg"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.classNameMatches(reg)"><!---->UiSelector.classNameMatches(reg)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-packagename-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.packageName(str)"><!---->UiSelector.packageName(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-packagenamecontains-str"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.packageNameContains(str)"><!---->UiSelector.packageNameContains(str)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-packagenamestartswith-prefix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.packageNameStartsWith(prefix)"><!---->UiSelector.packageNameStartsWith(prefix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-packagenameendswith-suffix"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.packageNameEndsWith(suffix)"><!---->UiSelector.packageNameEndsWith(suffix)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-packagenamematches-reg"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.packageNameMatches(reg)"><!---->UiSelector.packageNameMatches(reg)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-bounds-left-top-right-bottom"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.bounds(left, top, right, bottom)"><!---->UiSelector.bounds(left,
                              top, right, bottom)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-boundsinside-left-top-right-bottom"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.boundsInside(left, top, right, bottom)"><!---->UiSelector.boundsInside(left,
                              top, right, bottom)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-boundscontains-left-top-right-bottom"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.boundsContains(left, top, right, bottom)"><!---->UiSelector.boundsContains(left,
                              top, right, bottom)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-drawingorder-order"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.drawingOrder(order)"><!---->UiSelector.drawingOrder(order)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-clickable-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.clickable([b = true])"><!---->UiSelector.clickable([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-longclickable-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.longClickable([b = true])"><!---->UiSelector.longClickable([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-checkable-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.checkable([b = true])"><!---->UiSelector.checkable([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-selected-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.selected([b = true])"><!---->UiSelector.selected([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-enabled-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.enabled([b = true])"><!---->UiSelector.enabled([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-scrollable-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.scrollable([b = true])"><!---->UiSelector.scrollable([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-editable-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.editable([b = true])"><!---->UiSelector.editable([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-multiline-b-true"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.multiLine([b = true])"><!---->UiSelector.multiLine([b =
                              true])<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-findone"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.findOne()"><!---->UiSelector.findOne()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-findone-timeout"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.findOne(timeout)"><!---->UiSelector.findOne(timeout)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-findonce"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.findOnce()"><!---->UiSelector.findOnce()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-findonce-i"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.findOnce(i)"><!---->UiSelector.findOnce(i)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-find"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.find()"><!---->UiSelector.find()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-untilfind"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.untilFind()"><!---->UiSelector.untilFind()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-exists"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.exists()"><!---->UiSelector.exists()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-waitfor"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.waitFor()"><!---->UiSelector.waitFor()<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                          <li class="sidebar-sub-header"><a aria-current="page"
                              href="../automator/selector.html#uiselector-filter-f"
                              class="router-link-active router-link-exact-active nav-link sidebar-link heading"
                              aria-label="UiSelector.filter(f)"><!---->UiSelector.filter(f)<!----></a>
                            <ul class="sidebar-sub-headers"></ul>
                          </li>
                        </ul><!--]-->
                      </li>
                      <li><!--[--><a href="../automator/uiobject.html"
                          class="nav-link sidebar-link sidebar-page" aria-label="控件和控件集合"><!---->控件和控件集合<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                      <li><!--[--><a href="../automator/api.html"
                          class="nav-link sidebar-link sidebar-page"
                          aria-label="automator与其他函数"><!---->automator与其他函数<!----></a>
                        <ul class="sidebar-sub-headers"></ul><!--]-->
                      </li>
                    </ul>
                  </section>
                </li>
                <li><!--[--><a href="../coordinatesBasedAutomation.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="自动化 - 坐标操作"><!---->自动化 - 坐标操作<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../app.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="app - 应用"><!---->app - 应用<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../base64.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="base64"><!---->base64<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../colors.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="colors - 颜色"><!---->colors - 颜色<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../canvas.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="canvas - 画布"><!---->canvas - 画布<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../console.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="console - 控制台"><!---->console -
                    控制台<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../crypto.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="crypto - 加解密与消息摘要"><!---->crypto -
                    加解密与消息摘要<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../debug.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="debug - 调试工具"><!---->debug - 调试工具<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../device.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="device - 设备"><!---->device - 设备<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../dialogs.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="dialogs - 对话框"><!---->dialogs -
                    对话框<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../engines.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="engines - 脚本引擎"><!---->engines -
                    脚本引擎<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../events.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="events - 事件与监听"><!---->events -
                    事件与监听<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../floaty.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="floaty - 悬浮窗"><!---->floaty - 悬浮窗<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../files.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="files - 文件系统"><!---->files - 文件系统<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../globals.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="globals - 全局变量与函数"><!---->globals -
                    全局变量与函数<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../http.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="http - HTTP网络请求"><!---->http -
                    HTTP网络请求<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../images.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="images - 图片处理"><!---->images -
                    图片处理<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../keys.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="keys - 按键模拟"><!---->keys - 按键模拟<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../media.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="media - 多媒体"><!---->media - 多媒体<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../modules.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="module - 模块"><!---->module - 模块<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../ocr.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="ocr - 文字识别"><!---->ocr - 文字识别<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../plugins.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="plugins - 插件"><!---->plugins - 插件<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../powerManager.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="power_manager - 电源管理"><!---->power_manager -
                    电源管理<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../sensors.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="sensors - 传感器"><!---->sensors -
                    传感器<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../shell.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="shell - Shell命令"><!---->shell -
                    Shell命令<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../storages.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="storages - 本地存储"><!---->storages -
                    本地存储<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../settings.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="settings - 设置"><!---->settings -
                    设置<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../threads.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="threads - 多线程"><!---->threads -
                    多线程<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../timers.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="timers - 定时器"><!---->timers - 定时器<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../timedTasks.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="work_manager - 定时与任务"><!---->work_manager -
                    定时与任务<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li>
                  <section class="sidebar-group"><button class="sidebar-heading clickable"><!----><span class="title">ui
                        - 用户界面</span><span class="arrow right"></span></button><!----></section>
                </li>
                <li><!--[--><a href="../util.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="util - 工具"><!---->util - 工具<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../webSocket.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="WebSocket"><!---->WebSocket<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
                <li><!--[--><a href="../zip.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="zip - 压缩与解压"><!---->zip - 压缩与解压<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
          <li>
            <section class="sidebar-group">
              <p class="sidebar-heading"><!----><span class="title">进阶</span><!----></p>
              <ul class="sidebar-links">
                <li><!--[--><a href="../scriptingJava.html"
                    class="nav-link sidebar-link sidebar-page" aria-label="和Java交互"><!---->和Java交互<!----></a>
                  <ul class="sidebar-sub-headers"></ul><!--]-->
                </li>
              </ul>
            </section>
          </li>
        </ul><!--[--><!----><!--]-->
      </aside><!--[-->
      <main class="page" id="main-content"><!---->
        <nav class="breadcrumb">
          <ol vocab="https://schema.org/" typeof="BreadcrumbList">
            <li class="" property="itemListElement" typeof="ListItem"><a href="https://pro.autojs.org/docs/" class=""
                property="item" typeof="WebPage"><span class="icon iconfont icon-home"></span><span
                  property="name">Auto.js Pro</span></a>
              <meta property="position" content="1">
            </li>
            <li class="" property="itemListElement" typeof="ListItem"><a href="../"
                class="" property="item" typeof="WebPage"><!----><span property="name">阅读须知</span></a>
              <meta property="position" content="2">
            </li>
            <li class="" property="itemListElement" typeof="ListItem"><a
                href="../automator/" class="" property="item"
                typeof="WebPage"><!----><span property="name">入门介绍</span></a>
              <meta property="position" content="3">
            </li>
            <li class="is-active" property="itemListElement" typeof="ListItem"><a aria-current="page"
                href="../automator/selector.html"
                class="router-link-active router-link-exact-active" property="item" typeof="WebPage"><!----><span
                  property="name">选择器</span></a>
              <meta property="position" content="4">
            </li>
          </ol>
        </nav>
        <div class="page-title">
          <h1><!---->选择器</h1>
          <div class="page-info"><span class="date-info" aria-label="写作日期📅" data-balloon-pos="down"><svg
                xmlns="http://www.w3.org/2000/svg" class="icon calendar-icon" viewBox="0 0 1024 1024"
                fill="currentColor" aria-label="calendar icon">
                <path
                  d="M716.4 110.137c0-18.753-14.72-33.473-33.472-33.473-18.753 0-33.473 14.72-33.473 33.473v33.473h66.993v-33.473zm-334.87 0c0-18.753-14.72-33.473-33.473-33.473s-33.52 14.72-33.52 33.473v33.473h66.993v-33.473zm468.81 33.52H716.4v100.465c0 18.753-14.72 33.473-33.472 33.473a33.145 33.145 0 01-33.473-33.473V143.657H381.53v100.465c0 18.753-14.72 33.473-33.473 33.473a33.145 33.145 0 01-33.473-33.473V143.657H180.6A134.314 134.314 0 0046.66 277.595v535.756A134.314 134.314 0 00180.6 947.289h669.74a134.36 134.36 0 00133.94-133.938V277.595a134.314 134.314 0 00-133.94-133.938zm33.473 267.877H147.126a33.145 33.145 0 01-33.473-33.473c0-18.752 14.72-33.473 33.473-33.473h736.687c18.752 0 33.472 14.72 33.472 33.473a33.145 33.145 0 01-33.472 33.473z">
                </path>
              </svg><span>2022年10月27日</span>
              <meta property="datePublished" content="2022-10-27T05:15:37.000Z">
            </span></div>
          <hr>
        </div>
        <div class="toc-place-holder">
          <aside id="toc">
            <div class="toc-header">此页内容</div>
            <div class="toc-wrapper">
              <ul class="toc-list">
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#selector"
                    class="router-link-active router-link-exact-active toc-link level2">selector()</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-algorithm-algorithm"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.algorithm(algorithm)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-text-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.text(str)</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-textcontains-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.textContains(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-textstartswith-prefix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.textStartsWith(prefix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-textendswith-suffix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.textEndsWith(suffix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-textmatches-reg"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.textMatches(reg)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-desc-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.desc(str)</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-desccontains-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.descContains(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-descstartswith-prefix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.descStartsWith(prefix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-descendswith-suffix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.descEndsWith(suffix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-descmatches-reg"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.descMatches(reg)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-id-resid"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.id(resId)</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-idcontains-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.idContains(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-idstartswith-prefix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.idStartsWith(prefix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-idendswith-suffix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.idEndsWith(suffix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-idmatches-reg"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.idMatches(reg)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-classname-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.className(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-classnamecontains-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.classNameContains(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-classnamestartswith-prefix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.classNameStartsWith(prefix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-classnameendswith-suffix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.classNameEndsWith(suffix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-classnamematches-reg"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.classNameMatches(reg)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-packagename-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.packageName(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-packagenamecontains-str"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.packageNameContains(str)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-packagenamestartswith-prefix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.packageNameStartsWith(prefix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-packagenameendswith-suffix"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.packageNameEndsWith(suffix)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-packagenamematches-reg"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.packageNameMatches(reg)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-bounds-left-top-right-bottom"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.bounds(left, top,
                    right, bottom)</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-boundsinside-left-top-right-bottom"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.boundsInside(left,
                    top, right, bottom)</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-boundscontains-left-top-right-bottom"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.boundsContains(left,
                    top, right, bottom)</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-drawingorder-order"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.drawingOrder(order)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-clickable-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.clickable([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-longclickable-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.longClickable([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-checkable-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.checkable([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-selected-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.selected([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-enabled-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.enabled([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-scrollable-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.scrollable([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-editable-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.editable([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-multiline-b-true"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.multiLine([b =
                    true])</a></li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-findone"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.findOne()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-findone-timeout"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.findOne(timeout)</a>
                </li><!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-findonce"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.findOnce()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-findonce-i"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.findOnce(i)</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-find"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.find()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-untilfind"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.untilFind()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-exists"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.exists()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-waitfor"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.waitFor()</a></li>
                <!---->
                <li class="toc-item"><a aria-current="page"
                    href="../automator/selector.html#uiselector-filter-f"
                    class="router-link-active router-link-exact-active toc-link level2">UiSelector.filter(f)</a></li>
                <!---->
              </ul>
            </div>
          </aside>
        </div><!---->
        <div class="theme-hope-content">
          <h1 id="选择器" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#%E9%80%89%E6%8B%A9%E5%99%A8"
              aria-hidden="true">#</a> 选择器</h1>
          <p>UiSelector即选择器，用于通过各种条件选取屏幕上的控件，再对这些控件进行点击、长按等动作。这里需要先简单介绍一下控件和界面的相关知识。</p>
          <p>
            一般软件的界面是由一个个控件构成的，例如图片部分是一个图片控件(ImageView)，文字部分是一个文字控件(TextView)；同时，通过各种布局来决定各个控件的位置，例如，线性布局(LinearLayout)里面的控件都是按水平或垂直一次叠放的，列表布局(AbsListView)则是以列表的形式显示控件。
          </p>
          <p>控件有各种属性，包括文本(text), 描述(desc), 类名(className),
            id等等。我们通常用一个控件的属性来找到这个控件，例如，想要点击某聊天应用的聊天窗口的"发送"按钮，我们就可以通过他的文本属性为"发送"来找到这个控件并点击他，具体代码为:</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">var</span> sendButton <span class="token operator">=</span> <span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"发送"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
sendButton<span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>在这个例子中,
            <code><span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"发送"</span><span class="token punctuation">)</span></code>表示一个条件(文本属性为"发送")，<code><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>表示基于这个条件找到一个符合条件的控件，从而我们可以得到发送按钮sendButton，再执行<code>sendButton<span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>即可点击"发送"按钮。
          </p>
          <p>
            用文本属性来定位按钮控件、文本控件通常十分有效。但是，如果一个控件是图片控件，比如Auto.js主界面右上角的搜索图标，他没有文本属性，这时需要其他属性来定位他。我们如何查看他有什么属性呢？首先打开悬浮窗和无障碍服务，点击蓝色的图标(布局分析),
            可以看到以下界面：</p>
          <p>之后我们点击搜索图标，可以看到他有以下属性：</p>
          <p>我们注意到这个图标的desc(描述)属性为"搜索"，那么我们就可以通过desc属性来定位这个控件，得到点击搜索图标的代码为:</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">desc</span><span class="token punctuation">(</span><span class="token string">"搜索"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <p>可能心细的你可能注意到了，这个控件还有很多其他的属性，例如checked, className,
            clickable等等，为什么不用这些属性来定位搜索图标呢？答案是，其他控件也有这些值相同的属性、尝试一下你就可以发现很多其他控件的checked属性和搜索控件一样都是<code><span class="token boolean">false</span></code>，如果我们用<code><span class="token function">checked</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span></code>作为条件，将会找到很多控件，而无法确定哪一个是搜索图标。因此，要找到我们想要的那个控件，<strong>选择器的条件通常需要是可唯一确定控件的</strong>。我们通常用一个独一无二的属性来定位一个控件，例如这个例子中就没有其他控件的desc(描述)属性为"搜索"。
          </p>
          <p>
            另外，对于这个搜索图标而言，id属性也是唯一的，我们也可以用<code><span class="token function">id</span><span class="token punctuation">(</span><span class="token string">"action_search"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>来点击这个控件。如果一个控件有id属性，那么这个属性很可能是唯一的，除了以下几种情况：
          </p>
          <ul>
            <li>被混淆的控件ID，可能名称都是相同的，或者在版本之间有变化</li>
            <li>列表中的控件，比如联系人列表等</li>
          </ul>
          <p>尽管id属性很方便，但也不总是最方便的，例如对于微信和网易云音乐，每次更新他的控件id都会变化，导致了相同代码对于不同版本的微信、网易云音乐并不兼容。</p>
          <p>除了这些属性外，主要还有以下几种属性：</p>
          <ul>
            <li><code><span class="token property">className</span></code>
              类名。类名表示一个控件的类型，例如文本控件为"android.widget.TextView", 图片控件为"android.widget.ImageView"等。</li>
            <li><code><span class="token property">packageName</span></code> 包名。包名表示控件所在的应用包名，例如Auto.js
              Pro界面的控件的包名为"org.autojs.autojspro"。</li>
            <li><code><span class="token property">bounds</span></code> 控件在屏幕上的范围。</li>
            <li><code><span class="token property">drawingOrder</span></code> 控件在父控件的绘制顺序。</li>
            <li><code><span class="token property">indexInParent</span></code> 控件在父控件的位置。</li>
            <li><code><span class="token property">clickable</span></code> 控件是否可点击。</li>
            <li><code><span class="token property">longClickable</span></code> 控件是否可长按。</li>
            <li><code><span class="token property">checkable</span></code> 控件是否可勾选。</li>
            <li><code><span class="token property">checked</span></code> 控件是否可已勾选。</li>
            <li><code><span class="token property">scrollable</span></code> 控件是否可滑动。</li>
            <li><code><span class="token property">selected</span></code> 控件是否已选择。</li>
            <li><code><span class="token property">editable</span></code> 控件是否可编辑。</li>
            <li><code><span class="token property">visibleToUser</span></code> 控件是否可见。</li>
            <li><code><span class="token property">enabled</span></code> 控件是否已启用。</li>
            <li><code><span class="token property">depth</span></code> 控件的布局深度。</li>
          </ul>
          <p>
            有时候只靠一个属性并不能唯一确定一个控件，这时需要通过属性的组合来完成定位，例如<code><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"ImageView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">depth</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>，通过链式调用来组合条件。
          </p>
          <p>通常用这些技巧便可以解决大部分问题，即使解决不了问题，也可以通过布局分析的"生成代码"功能来尝试生成一些选择器代码。接下来的问题便是对选取的控件进行操作，包括：</p>
          <ul>
            <li>
              <code><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              点击。点击一个控件，前提是这个控件的clickable属性为true
            </li>
            <li>
              <code><span class="token function">longClick</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              长按。长按一个控件，前提是这个控件的longClickable属性为true
            </li>
            <li>
              <code><span class="token function">setText</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              设置文本，用于编辑框控件设置文本。
            </li>
            <li>
              <code><span class="token function">scrollForward</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>,
              <code><span class="token function">scrollBackward</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              滑动。滑动一个控件(列表等), 前提是这个控件的scrollable属性为true
            </li>
            <li>
              <code><span class="token function">exits</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              判断控件是否存在
            </li>
            <li>
              <code><span class="token function">waitFor</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>
              等待控件出现
            </li>
          </ul>
          <p>这些操作包含了绝大部分控件操作。根据这些我们可以很容易写出一个"刷屏"脚本(代码仅为示例，请不要在别人的群里测试，否则容易被踢):</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">while</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"EditText"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span><span class="token string">"刷屏..."</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"发送"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clicK</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>上面这段代码也可以写成：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">while</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"EditText"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">setText</span><span class="token punctuation">(</span><span class="token string">"刷屏..."</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"发送"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clicK</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>
            如果不加<code><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>而直接进行操作，则选择器会找出<strong>所有</strong>符合条件的控件并操作。
          </p>
          <p>
            另外一个比较常用的操作的滑动。滑动操作的第一步是找到需要滑动的控件，例如要滑动QQ消息列表则在悬浮窗布局层次分析中找到<code><span class="token property">AbsListView</span></code>，这个控件就是消息列表控件，如下图：
          </p>
          <p>长按可查看控件信息，注意到其scrollable属性为true，并找出其id为"recent_chat_list"，从而下滑QQ消息列表的代码为：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">id</span><span class="token punctuation">(</span><span class="token string">"recent_chat_list"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"AbsListView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">scrollForward</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <p>
            <code><span class="token function">scrollForward</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>为向前滑，包括下滑和右滑。
          </p>
          <p>选择器的入门教程暂且要这里，更多信息可以查看下面的文档和选择器进阶。</p>
          <h2 id="selector" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#selector" aria-hidden="true">#</a>
            selector()</h2>
          <ul>
            <li>返回 {UiSelector}</li>
          </ul>
          <p>创建一个新的选择器。但一般情况不需要使用该函数，因为可以直接用相应条件的语句创建选择器。</p>
          <p>
            由于历史遗留原因，本不应该这样设计(不应该让<code><span class="token function">id</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>,
            <code><span class="token function">text</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>等作为全局函数，而是应该用<code>By<span class="token punctuation">.</span><span class="token function">id</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>,
            <code>By<span class="token punctuation">.</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>)，但为了后向兼容性只能保留这个设计。
          </p>
          <p>这样的API设计会污染全局变量，后续可能会支持"去掉这些全局函数而使用By.***"的选项。</p>
          <h2 id="uiselector-algorithm-algorithm" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-algorithm-algorithm"
              aria-hidden="true">#</a> UiSelector.algorithm(algorithm)</h2>
          <p><strong>[v4.1.0新增]</strong></p>
          <ul>
            <li><code><span class="token property">algorithm</span></code> {string} 搜索算法，可选的值有： <ul>
                <li><code><span class="token constant">DFS</span></code> 深度优先算法，选择器的默认算法</li>
                <li><code><span class="token constant">BFS</span></code> 广度优先算法</li>
              </ul>
            </li>
          </ul>
          <p>指定选择器的搜索算法。例如：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">selector</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"文本"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">algorithm</span><span class="token punctuation">(</span><span class="token string">"BFS"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <p>广度优先在控件所在层次较低时，或者布局的层次不多时，通常能更快找到控件。</p>
          <h2 id="uiselector-text-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-text-str"
              aria-hidden="true">#</a> UiSelector.text(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 控件文本</li>
            <li>返回 {UiSelector} 返回选择器自身以便链式调用</li>
          </ul>
          <p>为当前选择器附加控件"text等于字符串str"的筛选条件。</p>
          <p>控件的text(文本)属性是文本控件上的显示的文字，例如微信左上角的"微信"文本。</p>
          <h2 id="uiselector-textcontains-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-textcontains-str"
              aria-hidden="true">#</a> UiSelector.textContains(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 要包含的字符串</li>
          </ul>
          <p>为当前选择器附加控件"text需要包含字符串str"的筛选条件。</p>
          <p>
            这是一个比较有用的条件，例如QQ动态页和微博发现页上方的"大家都在搜...."的控件可以用<code><span class="token function">textContains</span><span class="token punctuation">(</span><span class="token string">"大家都在搜"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>来获取。
          </p>
          <h2 id="uiselector-textstartswith-prefix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-textstartswith-prefix"
              aria-hidden="true">#</a> UiSelector.textStartsWith(prefix)</h2>
          <ul>
            <li><code><span class="token property">prefix</span></code> {string} 前缀</li>
          </ul>
          <p>为当前选择器附加控件"text需要以prefix开头"的筛选条件。</p>
          <p>
            这也是一个比较有用的条件，例如要找出Auto.js脚本列表中名称以"QQ"开头的脚本的代码为<code><span class="token function">textStartsWith</span><span class="token punctuation">(</span><span class="token string">"QQ"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>。
          </p>
          <h2 id="uiselector-textendswith-suffix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-textendswith-suffix"
              aria-hidden="true">#</a> UiSelector.textEndsWith(suffix)</h2>
          <ul>
            <li><code><span class="token property">suffix</span></code> {string} 后缀</li>
          </ul>
          <p>为当前选择器附加控件"text需要以suffix结束"的筛选条件。</p>
          <h2 id="uiselector-textmatches-reg" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-textmatches-reg"
              aria-hidden="true">#</a> UiSelector.textMatches(reg)</h2>
          <ul>
            <li><code><span class="token property">reg</span></code> {string} | {Regex} 要满足的正则表达式。</li>
          </ul>
          <p>为当前选择器附加控件"text需要满足正则表达式reg"的条件。</p>
          <p>有关正则表达式，可以查看<a href="http://www.runoob.com/Stringp/Stringp-example.html" target="_blank"
              rel="noopener noreferrer">正则表达式 - 菜鸟教程<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <p>
            需要注意的是，如果正则表达式是字符串，则需要使用<code>\\</code>来表达<code>\</code>(也即Java正则表达式的形式)，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"\\d+"</span><span class="token punctuation">)</span></code>匹配多位数字；但如果使用JavaScript语法的正则表达式则不需要，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">\d+</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">)</span></code>。但如果使用字符串的正则表达式则该字符串不能以"/"同时以"/"结束，也即不能写诸如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"/\\d+/"</span><span class="token punctuation">)</span></code>的表达式，否则会被开头的"/"和结尾的"/"会被忽略。
          </p>
          <h2 id="uiselector-desc-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-desc-str"
              aria-hidden="true">#</a> UiSelector.desc(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 控件文本</li>
            <li>返回 {UiSelector} 返回选择器自身以便链式调用</li>
          </ul>
          <p>为当前选择器附加控件"desc等于字符串str"的筛选条件。</p>
          <p>控件的desc(描述，全称为Content-Description)属性是对一个控件的描述，例如网易云音乐右上角的放大镜图标的描述为搜索。要查看一个控件的描述，同样地可以借助悬浮窗查看。</p>
          <p>desc属性同样是定位控件的利器。</p>
          <h2 id="uiselector-desccontains-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-desccontains-str"
              aria-hidden="true">#</a> UiSelector.descContains(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 要包含的字符串</li>
          </ul>
          <p>为当前选择器附加控件"desc需要包含字符串str"的筛选条件。</p>
          <h2 id="uiselector-descstartswith-prefix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-descstartswith-prefix"
              aria-hidden="true">#</a> UiSelector.descStartsWith(prefix)</h2>
          <ul>
            <li><code><span class="token property">prefix</span></code> {string} 前缀</li>
          </ul>
          <p>为当前选择器附加控件"desc需要以prefix开头"的筛选条件。</p>
          <h2 id="uiselector-descendswith-suffix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-descendswith-suffix"
              aria-hidden="true">#</a> UiSelector.descEndsWith(suffix)</h2>
          <ul>
            <li><code><span class="token property">suffix</span></code> {string} 后缀</li>
          </ul>
          <p>为当前选择器附加控件"desc需要以suffix结束"的筛选条件。</p>
          <h2 id="uiselector-descmatches-reg" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-descmatches-reg"
              aria-hidden="true">#</a> UiSelector.descMatches(reg)</h2>
          <ul>
            <li><code><span class="token property">reg</span></code> {string} | {Regex} 要满足的正则表达式。</li>
          </ul>
          <p>为当前选择器附加控件"desc需要满足正则表达式reg"的条件。</p>
          <p>有关正则表达式，可以查看<a href="http://www.runoob.com/Stringp/Stringp-example.html" target="_blank"
              rel="noopener noreferrer">正则表达式 - 菜鸟教程<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <p>
            需要注意的是，如果正则表达式是字符串，则需要使用<code>\\</code>来表达<code>\</code>(也即Java正则表达式的形式)，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"\\d+"</span><span class="token punctuation">)</span></code>匹配多位数字；但如果使用JavaScript语法的正则表达式则不需要，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">\d+</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">)</span></code>。但如果使用字符串的正则表达式则该字符串不能以"/"同时以"/"结束，也即不能写诸如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"/\\d+/"</span><span class="token punctuation">)</span></code>的表达式，否则会被开头的"/"和结尾的"/"会被忽略。
          </p>
          <h2 id="uiselector-id-resid" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-id-resid"
              aria-hidden="true">#</a> UiSelector.id(resId)</h2>
          <ul>
            <li><code><span class="token property">resId</span></code> {string}
              控件的id，以"包名:id/"开头，例如"com.tencent.mm:id/send_btn"。<strong>也可以不指定包名</strong>，这时会以当前正在运行的应用的包名来补全id。例如id("send_btn"),在界面想当于id("com.tencent.mobileqq:id/send_btn")。
            </li>
          </ul>
          <p>为当前选择器附加"id等于resId"的筛选条件。</p>
          <p>控件的id属性通常是可以用来确定控件的唯一标识，如果一个控件有id，那么使用id来找到他是最好的方法。要查看屏幕上的控件的id，可以开启悬浮窗并使用界面工具，点击相应控件即可查看。若查看到的控件id为null,
            表示该控件没有id。另外，在列表中会出现多个控件的id相同的情况。例如微信的联系人列表，每个头像的id都是一样的。此时不能用id来唯一确定控件。</p>
          <p>在QQ界面经常会出现多个id为"name"的控件，在微信上则每个版本的id都会变化。对于这些软件而言比较难用id定位控件。</p>
          <h2 id="uiselector-idcontains-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-idcontains-str"
              aria-hidden="true">#</a> UiSelector.idContains(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} id要包含的字符串</li>
          </ul>
          <p>为当前选择器附加控件"id包含字符串str"的筛选条件。比较少用。</p>
          <h2 id="uiselector-idstartswith-prefix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-idstartswith-prefix"
              aria-hidden="true">#</a> UiSelector.idStartsWith(prefix)</h2>
          <ul>
            <li><code><span class="token property">prefix</span></code> {string} id前缀</li>
          </ul>
          <p>为当前选择器附加"id需要以prefix开头"的筛选条件。比较少用。</p>
          <h2 id="uiselector-idendswith-suffix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-idendswith-suffix"
              aria-hidden="true">#</a> UiSelector.idEndsWith(suffix)</h2>
          <ul>
            <li><code><span class="token property">suffix</span></code> {string} id后缀</li>
          </ul>
          <p>为当前选择器附加"id需要以suffix结束"的筛选条件。比较少用。</p>
          <h2 id="uiselector-idmatches-reg" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-idmatches-reg"
              aria-hidden="true">#</a> UiSelector.idMatches(reg)</h2>
          <ul>
            <li><code><span class="token property">reg</span></code> {Regex | string} id要满足的正则表达式</li>
          </ul>
          <p>附加id需要满足正则表达式。</p>
          <p>
            需要注意的是，如果正则表达式是字符串，则需要使用<code>\\</code>来表达<code>\</code>(也即Java正则表达式的形式)，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"\\d+"</span><span class="token punctuation">)</span></code>匹配多位数字；但如果使用JavaScript语法的正则表达式则不需要，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">\d+</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">)</span></code>。但如果使用字符串的正则表达式则该字符串不能以"/"同时以"/"结束，也即不能写诸如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"/\\d+/"</span><span class="token punctuation">)</span></code>的表达式，否则会被开头的"/"和结尾的"/"会被忽略。
          </p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">idMatches</span><span class="token punctuation">(</span><span class="token string">"[a-zA-Z]+"</span><span class="token punctuation">)</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-classname-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-classname-str"
              aria-hidden="true">#</a> UiSelector.className(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 控件文本</li>
            <li>返回 {UiSelector} 返回选择器自身以便链式调用</li>
          </ul>
          <p>为当前选择器附加控件"className等于字符串str"的筛选条件。</p>
          <p>控件的className(类名)表示一个控件的类别，例如文本控件的类名为android.widget.TextView。</p>
          <p>
            如果一个控件的类名以"android.widget."开头，则可以省略这部分，例如文本控件可以直接用<code><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"TextView"</span><span class="token punctuation">)</span></code>的选择器。
          </p>
          <p>常见控件的类名如下：</p>
          <ul>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>TextView</code>
              文本控件
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>ImageView</code>
              图片控件
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>Button</code>
              按钮控件
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>EditText</code>
              输入框控件
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>AbsListView</code>
              列表控件
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>LinearLayout</code>
              线性布局
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>FrameLayout</code>
              帧布局
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>RelativeLayout</code>
              相对布局
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>RelativeLayout</code>
              相对布局
            </li>
            <li>
              <code>android<span class="token punctuation">.</span>support<span class="token punctuation">.</span>v7<span class="token punctuation">.</span>widget<span class="token punctuation">.</span>RecyclerView</code>
              通常也是列表控件
            </li>
          </ul>
          <h2 id="uiselector-classnamecontains-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-classnamecontains-str"
              aria-hidden="true">#</a> UiSelector.classNameContains(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 要包含的字符串</li>
          </ul>
          <p>为当前选择器附加控件"className需要包含字符串str"的筛选条件。</p>
          <h2 id="uiselector-classnamestartswith-prefix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-classnamestartswith-prefix"
              aria-hidden="true">#</a> UiSelector.classNameStartsWith(prefix)</h2>
          <ul>
            <li><code><span class="token property">prefix</span></code> {string} 前缀</li>
          </ul>
          <p>为当前选择器附加控件"className需要以prefix开头"的筛选条件。</p>
          <h2 id="uiselector-classnameendswith-suffix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-classnameendswith-suffix"
              aria-hidden="true">#</a> UiSelector.classNameEndsWith(suffix)</h2>
          <ul>
            <li><code><span class="token property">suffix</span></code> {string} 后缀</li>
          </ul>
          <p>为当前选择器附加控件"className需要以suffix结束"的筛选条件。</p>
          <h2 id="uiselector-classnamematches-reg" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-classnamematches-reg"
              aria-hidden="true">#</a> UiSelector.classNameMatches(reg)</h2>
          <ul>
            <li><code><span class="token property">reg</span></code> {string} | {Regex} 要满足的正则表达式。</li>
          </ul>
          <p>为当前选择器附加控件"className需要满足正则表达式reg"的条件。</p>
          <p>有关正则表达式，可以查看<a href="http://www.runoob.com/Stringp/Stringp-example.html" target="_blank"
              rel="noopener noreferrer">正则表达式 - 菜鸟教程<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <p>
            需要注意的是，如果正则表达式是字符串，则需要使用<code>\\</code>来表达<code>\</code>(也即Java正则表达式的形式)，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"\\d+"</span><span class="token punctuation">)</span></code>匹配多位数字；但如果使用JavaScript语法的正则表达式则不需要，例如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token regex"><span class="token regex-delimiter">/</span><span class="token regex-source language-regex">\d+</span><span class="token regex-delimiter">/</span></span><span class="token punctuation">)</span></code>。但如果使用字符串的正则表达式则该字符串不能以"/"同时以"/"结束，也即不能写诸如<code><span class="token function">textMatches</span><span class="token punctuation">(</span><span class="token string">"/\\d+/"</span><span class="token punctuation">)</span></code>的表达式，否则会被开头的"/"和结尾的"/"会被忽略。
          </p>
          <h2 id="uiselector-packagename-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-packagename-str"
              aria-hidden="true">#</a> UiSelector.packageName(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 控件文本</li>
            <li>返回 {UiSelector} 返回选择器自身以便链式调用</li>
          </ul>
          <p>为当前选择器附加控件"packageName等于字符串str"的筛选条件。</p>
          <p>控件的packageName表示控件所属界面的应用包名。例如Auto.js Pro的包名为"org.autojs.autojspro", 那么Auto.js
            Pro界面的控件的packageName为"org.autojs.autojspro"。</p>
          <p>
            要查看一个应用的包名，可以用函数<code>app<span class="token punctuation">.</span><span class="token function">getPackageName</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>获取，例如<code><span class="token function">toast</span><span class="token punctuation">(</span>app<span class="token punctuation">.</span><span class="token function">getPackageName</span><span class="token punctuation">(</span><span class="token string">"微信"</span><span class="token punctuation">)</span><span class="token punctuation">)</span></code>。
          </p>
          <h2 id="uiselector-packagenamecontains-str" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-packagenamecontains-str"
              aria-hidden="true">#</a> UiSelector.packageNameContains(str)</h2>
          <ul>
            <li><code><span class="token property">str</span></code> {string} 要包含的字符串</li>
          </ul>
          <p>为当前选择器附加控件"packageName需要包含字符串str"的筛选条件。</p>
          <h2 id="uiselector-packagenamestartswith-prefix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-packagenamestartswith-prefix"
              aria-hidden="true">#</a> UiSelector.packageNameStartsWith(prefix)</h2>
          <ul>
            <li><code><span class="token property">prefix</span></code> {string} 前缀</li>
          </ul>
          <p>为当前选择器附加控件"packageName需要以prefix开头"的筛选条件。</p>
          <h2 id="uiselector-packagenameendswith-suffix" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-packagenameendswith-suffix"
              aria-hidden="true">#</a> UiSelector.packageNameEndsWith(suffix)</h2>
          <ul>
            <li><code><span class="token property">suffix</span></code> {string} 后缀</li>
          </ul>
          <p>为当前选择器附加控件"packageName需要以suffix结束"的筛选条件。</p>
          <h2 id="uiselector-packagenamematches-reg" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-packagenamematches-reg"
              aria-hidden="true">#</a> UiSelector.packageNameMatches(reg)</h2>
          <ul>
            <li><code><span class="token property">reg</span></code> {string} | {Regex} 要满足的正则表达式。</li>
          </ul>
          <p>为当前选择器附加控件"packageName需要满足正则表达式reg"的条件。</p>
          <p>有关正则表达式，可以查看<a href="http://www.runoob.com/Stringp/Stringp-example.html" target="_blank"
              rel="noopener noreferrer">正则表达式 - 菜鸟教程<span><svg class="external-link-icon"
                  xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px"
                  viewBox="0 0 100 100" width="15" height="15">
                  <path fill="currentColor"
                    d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z">
                  </path>
                  <polygon fill="currentColor"
                    points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9">
                  </polygon>
                </svg><span class="external-link-icon-sr-only">open in new window</span></span></a>。</p>
          <h2 id="uiselector-bounds-left-top-right-bottom" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-bounds-left-top-right-bottom"
              aria-hidden="true">#</a> UiSelector.bounds(left, top, right, bottom)</h2>
          <ul>
            <li><code><span class="token property">left</span></code> {number} 控件左边缘与屏幕左边的距离</li>
            <li><code><span class="token property">top</span></code> {number} 控件上边缘与屏幕上边的距离</li>
            <li><code><span class="token property">right</span></code> {number} 控件右边缘与屏幕左边的距离</li>
            <li><code><span class="token property">bottom</span></code> {number} 控件下边缘与屏幕上边的距离</li>
          </ul>
          <p>
            一个控件的bounds属性为这个控件在屏幕上显示的范围。我们可以用这个范围来定位这个控件。尽管用这个方法定位控件对于静态页面十分准确，却无法兼容不同分辨率的设备；同时对于列表页面等动态页面无法达到效果，因此使用不推荐该选择器。
          </p>
          <p>注意参数的这四个数字不能随意填写，必须精确的填写控件的四个边界才能找到该控件。例如，要点击QQ主界面的右上角加号，我们用布局分析查看该控件的属性，如下图：</p>
          <p>可以看到bounds属性为(951, 67, 1080,
            196)，此时使用代码<code><span class="token function">bounds</span><span class="token punctuation">(</span><span class="token number">951</span><span class="token punctuation">,</span> <span class="token number">67</span><span class="token punctuation">,</span> <span class="token number">1080</span><span class="token punctuation">,</span> <span class="token number">196</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clickable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>即可点击该控件。
          </p>
          <h2 id="uiselector-boundsinside-left-top-right-bottom" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-boundsinside-left-top-right-bottom"
              aria-hidden="true">#</a> UiSelector.boundsInside(left, top, right, bottom)</h2>
          <ul>
            <li><code><span class="token property">left</span></code> {number} 范围左边缘与屏幕左边的距离</li>
            <li><code><span class="token property">top</span></code> {number} 范围上边缘与屏幕上边的距离</li>
            <li><code><span class="token property">right</span></code> {number} 范围右边缘与屏幕左边的距离</li>
            <li><code><span class="token property">bottom</span></code> {number} 范围下边缘与屏幕上边的距离</li>
          </ul>
          <p>为当前选择器附加控件"bounds需要在left, top, right, bottom构成的范围里面"的条件。</p>
          <p>这个条件用于限制选择器在某一个区域选择控件。例如要在屏幕上半部分寻找文本控件TextView，代码为:</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">var</span> w <span class="token operator">=</span> <span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"TextView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">boundsInside</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">,</span> device<span class="token punctuation">.</span>width<span class="token punctuation">,</span> device<span class="token punctuation">.</span>height <span class="token operator">/</span> <span class="token number">2</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">log</span><span class="token punctuation">(</span>w<span class="token punctuation">.</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <p>
            其中我们使用了<code>device<span class="token punctuation">.</span>width</code>来获取屏幕宽度，<code>device<span class="token punctuation">.</span>height</code>来获取屏幕高度。
          </p>
          <h2 id="uiselector-boundscontains-left-top-right-bottom" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-boundscontains-left-top-right-bottom"
              aria-hidden="true">#</a> UiSelector.boundsContains(left, top, right, bottom)</h2>
          <ul>
            <li><code><span class="token property">left</span></code> {number} 范围左边缘与屏幕左边的距离</li>
            <li><code><span class="token property">top</span></code> {number} 范围上边缘与屏幕上边的距离</li>
            <li><code><span class="token property">right</span></code> {number} 范围右边缘与屏幕左边的距离</li>
            <li><code><span class="token property">bottom</span></code> {number} 范围下边缘与屏幕上边的距离</li>
          </ul>
          <p>为当前选择器附加控件"bounds需要包含left, top, right, bottom构成的范围"的条件。</p>
          <p>这个条件用于限制控件的范围必须包含所给定的范围。例如给定一个点(500, 300), 寻找在这个点上的可点击控件的代码为:</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">var</span> w <span class="token operator">=</span> <span class="token function">boundsContains</span><span class="token punctuation">(</span><span class="token number">500</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">,</span> <span class="token number">300</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clickable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
w<span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-drawingorder-order" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-drawingorder-order"
              aria-hidden="true">#</a> UiSelector.drawingOrder(order)</h2>
          <ul>
            <li><code><span class="token property">order</span></code> {number} 控件在父视图中的绘制顺序</li>
          </ul>
          <p>为当前选择器附加控件"drawingOrder等于order"的条件。</p>
          <p>drawingOrder为一个控件在父控件中的绘制顺序，通常可以用于区分同一层次的控件。</p>
          <p>但该属性在Android 7.0以上才能使用。</p>
          <h2 id="uiselector-clickable-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-clickable-b-true"
              aria-hidden="true">#</a> UiSelector.clickable([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否可点击</li>
          </ul>
          <p>
            为当前选择器附加控件是否可点击的条件。但并非所有clickable为false的控件都真的不能点击，这取决于控件的实现。对于自定义控件(例如显示类名为android.view.View的控件)很多的clickable属性都为false都却能点击。
          </p>
          <p>
            需要注意的是，可以省略参数<code><span class="token property">b</span></code>而表示选择那些可以点击的控件，例如<code><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"ImageView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clickable</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>表示可以点击的图片控件的条件，<code><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"ImageView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">clickable</span><span class="token punctuation">(</span><span class="token boolean">false</span><span class="token punctuation">)</span></code>表示不可点击的图片控件的条件。
          </p>
          <h2 id="uiselector-longclickable-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-longclickable-b-true"
              aria-hidden="true">#</a> UiSelector.longClickable([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否可长按</li>
          </ul>
          <p>为当前选择器附加控件是否可长按的条件。</p>
          <h2 id="uiselector-checkable-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-checkable-b-true"
              aria-hidden="true">#</a> UiSelector.checkable([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否可勾选</li>
          </ul>
          <p>为当前选择器附加控件是否可勾选的条件。勾选通常是对于勾选框而言的，例如图片多选时左上角通常有一个勾选框。</p>
          <h2 id="uiselector-selected-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-selected-b-true"
              aria-hidden="true">#</a> UiSelector.selected([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否被选</li>
          </ul>
          <p>为当前选择器附加控件是否已选中的条件。被选中指的是，例如QQ聊天界面点击下方的"表情按钮"时，会出现自己收藏的表情，这时"表情按钮"便处于选中状态，其selected属性为true。</p>
          <h2 id="uiselector-enabled-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-enabled-b-true"
              aria-hidden="true">#</a> UiSelector.enabled([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否已启用</li>
          </ul>
          <p>为当前选择器附加控件是否已启用的条件。大多数控件都是启用的状态(enabled为true)，处于“禁用”状态通常是灰色并且不可点击。</p>
          <h2 id="uiselector-scrollable-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-scrollable-b-true"
              aria-hidden="true">#</a> UiSelector.scrollable([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否可滑动</li>
          </ul>
          <p>为当前选择器附加控件是否可滑动的条件。滑动包括上下滑动和左右滑动。</p>
          <p>可以用这个条件来寻找可滑动控件来滑动界面。例如滑动Auto.js的脚本列表的代码为:</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"android.support.v7.widget.RecyclerView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">scrollable</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">scrollForward</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//或者classNameEndsWith("RecyclerView").scrollable().findOne().scrollForward();</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-editable-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-editable-b-true"
              aria-hidden="true">#</a> UiSelector.editable([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示控件是否可编辑</li>
          </ul>
          <p>为当前选择器附加控件是否可编辑的条件。一般来说可编辑的控件为输入框(EditText)，但不是所有的输入框(EditText)都可编辑。</p>
          <h2 id="uiselector-multiline-b-true" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-multiline-b-true"
              aria-hidden="true">#</a> UiSelector.multiLine([b = true])</h2>
          <ul>
            <li><code><span class="token property">b</span></code> {Boolean} 表示文本或输入框控件是否是多行显示的</li>
          </ul>
          <p>为当前选择器附加控件是否文本或输入框控件是否是多行显示的条件。</p>
          <h2 id="uiselector-findone" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-findone"
              aria-hidden="true">#</a> UiSelector.findOne()</h2>
          <ul>
            <li>返回 {<a href="../automator/uiobject">UiObject</a>}</li>
          </ul>
          <p>根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，直到屏幕上出现满足条件的一个控件为止，并返回该控件。如果找不到控件，当屏幕内容发生变化时会重新寻找，直至找到。</p>
          <p>
            需要注意的是，如果屏幕上一直没有出现所描述的控件，则该函数会阻塞，直至所描述的控件出现为止。因此此函数不会返回<code><span class="token keyword">null</span></code>。
          </p>
          <p>
            该函数本来应该命名为<code><span class="token function">untilFindOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>，但由于历史遗留原因已经无法修改。如果想要只在屏幕上搜索一次而不是一直搜索，请使用<code><span class="token function">findOnce</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>。
          </p>
          <p>
            另外，如果屏幕上有多个满足条件的控件，<code><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>采用深度优先搜索(DFS)，会返回该搜索算法找到的第一个控件。注意控件找到的顺序有时会起到作用。
          </p>
          <h2 id="uiselector-findone-timeout" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-findone-timeout"
              aria-hidden="true">#</a> UiSelector.findOne(timeout)</h2>
          <ul>
            <li><code><span class="token property">timeout</span></code> {number} 搜索的超时时间，单位毫秒</li>
            <li>返回 {<a href="../automator/uiobject">UiObject</a>}</li>
          </ul>
          <p>
            根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，直到屏幕上出现满足条件的一个控件为止，并返回该控件；如果在timeout毫秒的时间内没有找到符合条件的控件，则终止搜索并返回<code><span class="token keyword">null</span></code>。
          </p>
          <p>
            该函数类似于不加参数的<code><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>，只不过加上了时间限制。
          </p>
          <p>示例：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token comment">//启动Auto.js</span>
<span class="token function">launchApp</span><span class="token punctuation">(</span><span class="token string">"Auto.js"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//在6秒内找出日志图标的控件</span>
<span class="token keyword">var</span> w <span class="token operator">=</span> <span class="token function">id</span><span class="token punctuation">(</span><span class="token string">"action_log"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token number">6000</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token comment">//如果找到控件则点击</span>
<span class="token keyword">if</span><span class="token punctuation">(</span>w <span class="token operator">!=</span> <span class="token keyword">null</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    w<span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{</span>
    <span class="token comment">//否则提示没有找到</span>
    <span class="token function">toast</span><span class="token punctuation">(</span><span class="token string">"没有找到日志图标"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-findonce" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-findonce"
              aria-hidden="true">#</a> UiSelector.findOnce()</h2>
          <ul>
            <li>返回 {<a href="../automator/uiobject">UiObject</a>}</li>
          </ul>
          <p>根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，如果找到符合条件的控件则返回该控件；否则返回<code><span class="token keyword">null</span></code>。
          </p>
          <h2 id="uiselector-findonce-i" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-findonce-i"
              aria-hidden="true">#</a> UiSelector.findOnce(i)</h2>
          <ul>
            <li><code><span class="token property">i</span></code> {number} 索引</li>
          </ul>
          <p>根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，并返回第 i + 1 个符合条件的控件；如果没有找到符合条件的控件，或者符合条件的控件个数 &lt; i,
            则返回<code><span class="token keyword">null</span></code>。</p>
          <p>注意这里的控件次序，是搜索算法深度优先搜索(DSF)决定的。</p>
          <h2 id="uiselector-find" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-find" aria-hidden="true">#</a>
            UiSelector.find()</h2>
          <ul>
            <li>返回 {<a href="../automator/uiobject#uicollection">UiCollection</a>}</li>
          </ul>
          <p>根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，找到所有满足条件的控件集合并返回。这个搜索只进行一次，并不保证一定会找到，因而会出现返回的控件集合为空的情况。</p>
          <p>
            不同于<code><span class="token function">findOne</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>或者<code><span class="token function">findOnce</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>只找到一个控件并返回一个控件，<code><span class="token function">find</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>函数会找出所有满足条件的控件并返回一个控件集合。之后可以对控件集合进行操作。
          </p>
          <p>可以通过empty()函数判断找到的是否为空。例如：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">var</span> c <span class="token operator">=</span> <span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"AbsListView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">find</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">if</span><span class="token punctuation">(</span><span class="token operator">!</span>c<span class="token punctuation">.</span><span class="token function">empty</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token function">toast</span><span class="token punctuation">(</span><span class="token string">"找到啦"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token keyword">else</span><span class="token punctuation">{</span>
    <span class="token function">toast</span><span class="token punctuation">(</span><span class="token string">"没找到╭(╯^╰)╮"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-untilfind" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-untilfind"
              aria-hidden="true">#</a> UiSelector.untilFind()</h2>
          <ul>
            <li>返回 {<a href="../automator/uiobject#uicollection">UiCollection</a>}</li>
          </ul>
          <p>根据当前的选择器所确定的筛选条件，对屏幕上的控件进行搜索，直到找到至少一个满足条件的控件为止，并返回所有满足条件的控件集合。</p>
          <p>
            该函数与<code><span class="token function">find</span><span class="token punctuation">(</span><span class="token punctuation">)</span></code>函数的区别在于，该函数永远不会返回空集合；但是，如果屏幕上一直没有出现满足条件的控件，则该函数会保持阻塞。
          </p>
          <h2 id="uiselector-exists" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-exists"
              aria-hidden="true">#</a> UiSelector.exists()</h2>
          <ul>
            <li>返回 {Boolean}</li>
          </ul>
          <p>判断屏幕上是否存在控件符合选择器所确定的条件。例如要判断某个文本出现就执行某个动作，可以用：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">if</span><span class="token punctuation">(</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token string">"某个文本"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">exists</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token comment">//要支持的动作</span>
<span class="token punctuation">}</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-waitfor" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-waitfor"
              aria-hidden="true">#</a> UiSelector.waitFor()</h2>
          <p>等待屏幕上出现符合条件的控件；在满足该条件的控件出现之前，该函数会一直保持阻塞。</p>
          <p>例如要等待包含"哈哈哈"的文本控件出现的代码为：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token function">textContains</span><span class="token punctuation">(</span><span class="token string">"哈哈哈"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">waitFor</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
            </div>
          </div>
          <h2 id="uiselector-filter-f" tabindex="-1"><a class="header-anchor"
              href="../automator/selector.html#uiselector-filter-f"
              aria-hidden="true">#</a> UiSelector.filter(f)</h2>
          <ul>
            <li><code><span class="token property">f</span></code> {Function} 过滤函数，参数为UiObject，返回值为boolean</li>
          </ul>
          <p>为当前选择器附加自定义的过滤条件。</p>
          <p>例如，要找出屏幕上所有文本长度为10的文本控件的代码为：</p>
          <div class="language-javascript ext-js line-numbers-mode"><button class="copy" aria-label="复制代码"
              data-copied="已复制" data-balloon-pos="left">
              <div class="copy-icon"></div>
            </button>
            <pre class="language-javascript" copy-code-registered=""><code><span class="token keyword">var</span> uc <span class="token operator">=</span> <span class="token function">className</span><span class="token punctuation">(</span><span class="token string">"TextView"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span><span class="token keyword">function</span><span class="token punctuation">(</span><span class="token parameter">w</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
    <span class="token keyword">return</span> w<span class="token punctuation">.</span><span class="token function">text</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span>length <span class="token operator">==</span> <span class="token number">10</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
            <div class="line-numbers" aria-hidden="true">
              <div class="line-number"></div>
              <div class="line-number"></div>
              <div class="line-number"></div>
            </div>
          </div>
        </div><!---->
        <footer class="page-meta"><!---->
          <div class="meta-item update-time"><span class="label">上次编辑于: </span><span class="info">2022/11/20
              17:30:10</span></div>
          <div class="meta-item contributors"><span class="label">贡献者: </span><span class="contributor"
              title="email: 946994919@qq.com">hyb1996</span></div>
        </footer>
        <nav class="page-nav"><a href="../automator/" class="nav-link active prev"
            aria-label="入门介绍">
            <div class="hint"><span class="arrow left"></span>上一页</div>
            <div class="link"><!---->入门介绍</div>
          </a><a href="../automator/uiobject.html" class="nav-link next"
            aria-label="控件和控件集合">
            <div class="hint">下一页<span class="arrow right"></span></div>
            <div class="link">控件和控件集合<!----></div>
          </a></nav><!----><!---->
      </main><!--]--><!----><!--]-->
    </div><!--]--><!----><button class="sw-update-popup" tabindex="0">新内容已就绪<span class="icon-wrapper"><svg
          xmlns="http://www.w3.org/2000/svg" class="icon update-icon" viewBox="0 0 1024 1024" fill="currentColor"
          aria-label="update icon">
          <path
            d="M949.949 146.25v255.826c0 21.981-13.989 35.97-35.97 35.97H658.154c-13.988 0-25.983-7.992-33.973-21.981-5.997-13.989-4-27.977 7.991-39.97l79.942-77.946c-55.954-51.973-121.918-77.955-199.863-77.955-37.975 0-75.95 8.002-113.924 21.99-37.975 15.985-67.948 37.976-91.934 63.957-25.982 23.987-47.973 53.96-63.957 91.934-29.983 73.955-29.983 153.895 0 227.85 15.984 37.976 37.975 67.947 63.957 91.934 23.986 25.982 53.959 47.973 91.934 63.956 37.974 13.989 75.95 21.991 113.924 21.991 45.967 0 87.942-9.998 127.913-29.982 41.976-17.99 75.951-45.967 101.931-83.943 7.993-4 11.994-5.995 13.989-5.995 5.997 0 9.998 1.994 13.988 5.995l77.958 77.946c3.989 4 5.986 7.993 5.986 11.994 0 1.994-1.996 5.995-3.99 11.994-43.973 51.962-93.941 91.934-151.9 117.914-53.958 25.983-115.92 39.972-185.874 39.972-61.961 0-119.921-11.984-169.89-33.973-57.96-25.985-105.923-57.963-139.896-93.943-35.98-33.972-67.958-81.936-93.94-139.897-45.967-101.93-45.967-237.846 0-339.777 25.982-57.96 57.96-105.923 93.94-139.896 33.973-35.98 81.936-67.958 139.896-93.94 49.968-21.99 107.928-33.974 169.89-33.974 55.963 0 109.923 9.988 161.885 29.973 53.97 21.99 101.933 51.963 139.908 89.938l73.954-73.944c9.987-9.998 23.987-13.988 39.971-8.002 13.988 8.002 21.98 19.995 21.98 33.984z">
          </path>
        </svg></span></button><!--]-->
  </div>
  <script type="module" src="./选择器 _ Auto.js Pro文档_files/app.486b1949.js.下载" defer=""></script>


  <div id="message-container"></div>
</body>
<div id="photoShowViewer" class="sb_BingCA photoShow">
  <div class="photoshow-viewer-shadow"></div>
  <div class="photoshow-img-wrapper">
    <img>
    <div class="photoshow-view-mode-switch-tip">a</div>
  </div>
  <i class="photoshow-img-size"></i>
</div>

</html>